<?php


namespace App\Services\SDK;


use Illuminate\Support\Arr;

class SDKFactory
{
    protected $sdkConfig;

    /**
     * SDKFactory constructor.
     */
    public function __construct()
    {
        $this->sdkConfig = config('sdk', []);
    }

    public function getSdkConfig()
    {
        return $this->sdkConfig;
    }

    public function getSdk($sdkName)
    {
        if ($handler = Arr::get($this->sdkConfig, "{$sdkName}.handler")) {
            return app($handler)->loadConfig();
        }
        return null;
    }
}
